package rladidxo.basic;

import java.util.Scanner;

public class Ch04_235_05 {
public static void main(String[] args) {
	add add2 = new add();
	sub sub2 = new sub();
	mul mul2 = new mul();
	div div2 = new div();
	Scanner sc = new Scanner(System.in);
	System.out.print("두 정수와 연산자를 입력하시오(더하기:1,빼기:2,곱하기:3,나누기:4>>");
	int a = sc.nextInt();
	int b = sc.nextInt();
	int c = sc.nextInt();
	
	if(c==1){add2.a = a; add2.b = b; add2.calculate();System.out.println(add2.calculate());}
	else if(c==2){sub2.a = a; sub2.b = b;sub2.calculate();System.out.println(sub2.calculate());}
	else if(c==3){mul2.a = a; mul2.b = b;mul2.calculate();System.out.println(mul2.calculate());}
	else if(c==4){div2.a = a; div2.b = b;div2.calculate();System.out.println(div2.calculate());}
	else{System.out.println("제대로 입력해주세요.");}
}//main
}//class
class add{
	int a;
	int b;
	int sum;
	public add() {}
	public add(int a,int b) {
		this.a = a;
		this.b = b;
	}
	void setValue(int a, int b){
	}
	int calculate(){
		int sum = a+b;
		return sum;
	}
}//add
class sub{
	int a;
	int b;
	int sub;
	public sub() {}
	public sub(int a, int b) {
		this.a = a;
		this.b = b;
	}
	void setValue(){}
	int calculate(){
		int sub;
		if(a>b){
		sub = a-b;}
		else{ sub = b-a;}
		return sub;
	}
}//sub
class mul{
	int a;
	int b;
	int mul;
	public mul() {}
	public mul(int a, int b) {
		this.a = a;
		this.b = b;
	}
	void setValue(){}
	int calculate(){
		int mul = a*b;
		return mul;
	}
}//mul
class div{
	int a;
	int b;
	int div;
	public div() {}
	public div(int a, int b) {
		this.a = a;
		this.b = b;
	}
	void setValue(){}
	int calculate(){
		int div;
		if(a>b){
		div = a/b;}
		else{ div = b/a;}
		return div;
	}

}